<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/token.jsp"%>
<%@ include file="/common/user.jsp"%>
<%
    String date = input.getDesc("date", "=====");
    Integer uid = token.getUid();
    List<Arrangement> list = QBuilder.db("basedb").select().from("Arrangement").where(new Where("hospital=", hospital).and("status=", STATUS_ENABLE).and("DATE_FORMAT(start,'%Y-%m-%d')=", date).and("partner=", uid)).order("start", QBuilder.desc).query().getResultObj();
    if (isEmpty(list)) {
        msg = new Message(30041, "暂无日程");
        msg.put("data", new ArrayList());
        Tools.encryptPrint(out, msg);
        return;
    }
    List<Map> result = new ArrayList<Map>();
    for (int i = 0; i < list.size(); i++) {
        Arrangement ag = list.get(i);
        Map map = Tools.toMap(ag);
        map.put("create", uid.equals(ag.getUid()));
        result.add(map);
    }
    if (isEmpty(result)) {
        msg = new Message(30041, "暂无日程");
    }
    msg.put("data", result);
    Tools.encryptPrint(out, msg);
%>
